<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>OA</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" type="text/css" href="../../css/lib/mui/mui.css">
		<link rel="stylesheet" type="text/css" href="../../css/common/animate.css">
		<link rel="stylesheet" type="text/css" href="../../css/common/common.css"/>
	</head>

	<body>
		<header class="header-backcolor mui-bar mui-bar-nav">
			<a id="title_icon" class="mui-action-back  pan_header_a_left">
					<div id="backBtn">
						<img id="back_img" src="../../img/menu/ico_return.png" class="pan_header_left_img_block" >
						<button class="mui-action-back mui-btn mui-btn-blue mui-btn-link mui-btn-nav mui-pull-left">
							<span class="pan_header_left_span_block" id="back">返回</span>
						</button>	
					</div>
			</a>
			<h1 class="mui-title" id="title"></h1>
		</header>
		<div id="content"  class="mui-scroll-wrapper mui-content" >
			<ul id="contentList" class="mui-table-view mui-table-view-striped mui-table-view-condensed">

		    </ul>
		</div>
	</body>
		<script type="text/javascript" src="../../js/common/config.js" ></script>
		<script type="text/javascript" src="../../js/lib/mui/mui.js"></script>
		<script type="text/javascript" src="../../js/lib/jquery/jquery.js"></script>
		<script type="text/javascript" src="../../js/common/common.js" ></script>
		<script type="text/javascript" src="../../js/lib/jquery/jquery.json.js" ></script> 
		<script>
			mui.init({
				swipeBack:false, //启用右滑关闭功能
				keyEventBind: {
					backbutton: false  //关闭back按键监听
				}
			}); 
			mui.plusReady(initSomething);
			
			var userid;
			function initSomething(){
				var self = plus.webview.currentWebview();
				userid = common.utils.getUserId();
				var groupid = self.groupid;
				var name = self.name;
				$("#title").html(name);
				initData(groupid);
			}
			
			//获取数据
			function initData(groupid){
				$("#loading").show();
				mui.ajax(ctx+"mobile/common/getSpecialContentList?groupid="+groupid,{
					dataType:'json',//服务器返回json格式数据
					type:'post',//HTTP请求类型
					timeout:10000,//超时时间设置为10秒；	              
					success:function(data){
				       	if(data&&data.success){
				       		var html = "";
				       		if(data.data){
				       			var list = data.data;
				       			$.each(list,function(i,d){
				       				if(!d.img){
				       					d.img="../../img/app/defaultImg.png"
				       				}else{
				       					d.img=ctx+d.img;
				       				}
				       				html = html + '<li class="mui-table-view-cell mui-media contentLi" data-id="'+d.id+'">';
										html = html + '<a href="javascript:;">';
											html = html + '<img class="mui-media-object mui-pull-left" src="'+d.img+'">';
											html = html + '<div class="mui-media-body">';
												html = html + d.title;
												html = html + '<p class="mui-ellipsis">'+(d.text_content?d.text_content:'')+'</p>';
											html = html + '</div>';
										html = html + '</a>';
									html = html + '</li>';
				       			});
				       			$("#contentList").html(html);
				       			$("#contentList").show();
				       			$(".contentLi").on("tap",function(){//详情页面
									var content = plus.webview.create("../content/content.html", "../content/content.html", {scrollIndicator:'none'},{dataId:$(this).attr("data-id")});
									//	显示新页面
									plus.webview.show(content, "slide-in-right", "350ms", function() {}, false);
								});
				       		}
				      	}else{
				      		alert('服务器异常链接失败!');
				      	}
					},
					error:function(xhr,type,errorThrown){
						alert('服务器异常链接失败!');
					}
				});
			
			}

		</script>
</html>